﻿using System.IO;
using StockApi.Interfaces;

namespace StockApi.StockProperties
{
    public class StockResult : IStockResult
    {
        public StockResult()
        {
            
        }

        public StockResult(string metaData)
        {
            MetaData = metaData;
        }

        public string MetaData { get; set; }

        public void WriteRaw<T>(string fileName)
        {
            if (MetaData != null)
            {
                File.WriteAllText(fileName,MetaData);
            }
        }

        public int CompareTo(IStockResult secondStockResult)
        {
            if (MetaData == secondStockResult.MetaData)
            {
                return 0;
            }
            return -1;
        }

    }
}